from typing import Optional
from datetime import datetime
from pydantic import BaseModel, Field

class UserConfigBase(BaseModel):
    """用户配置基础模型"""
    api_key: Optional[str] = Field(None, description="API密钥")
    theme: str = Field("light", description="主题")
    language: str = Field("zh", description="语言")
    max_tokens: int = Field(1000, description="最大令牌数")
    temperature: float = Field(0.7, description="温度参数")

class UserConfigCreate(UserConfigBase):
    """创建用户配置模型"""
    pass

class UserConfigUpdate(UserConfigBase):
    """更新用户配置模型"""
    pass

class UserConfigResponse(UserConfigBase):
    """用户配置响应模型"""
    id: int
    created_at: datetime
    updated_at: datetime

    class Config:
        from_attributes = True 